# from openpyxl import load_workbook
# from tools.handle_path import data_dir
#
# wb_obj=load_workbook(filename=data_dir)
# # datas=sheet_obj = wb_obj["place_order"].iter_rows(values_only=True)
# datas = wb_obj.sheetnames
#
#
# print(datas)



# fib = int(input())
# def s(a):
#     if a<=2:
#         return 1
#     return s(a-1)+s(a-2)
# res = s(fib)
# print(res)

# # 输出斐波那契数列
# arr = []
# def fib(n):
#     a, b = 1, 1
#     while b < n:
#         a, b = b, a + b
#         arr.append(a)
#
# n = int(input())
# fib(n)
# print(arr)
# print(len(arr))

#浅拷贝  复制一份，修改原字典，复制到是内容地址，修改后读出来会变
# dict1 = {'key3':[1,2,3],'key2':'张三','key1':'孙悟空'}
# new_dict1 = dict1.copy()
# print('原字典',dict1)
# print('浅拷贝',new_dict1)
#
# dict1['key3'].append('aaaaaaaaaaaa')
# print('原字典',dict1)
# print('浅拷贝',new_dict1)

#深拷贝 复制一份，修改原字典，修改后读出来还是原字典
# import copy
#
# dict2 = {'key3':[1,2,3],'key2':'张三','key1':'孙悟空'}
# new_dict2 = copy.deepcopy(dict2)
# print('原字典',dict2)
# print('深拷贝字典',new_dict2)
# #修改原字典
# dict2['key3'].append('aaaaaaaaaaaa')
# print('原字典',dict2)
# print('深拷贝字典',new_dict2)
#


# # Demo
# Demo_lists = [1, 2, 3, 4, 5, 6, 7]
#
# Demo_result_lists = filter(lambda x: x > 2, Demo_lists)
# print(list(Demo_result_lists),f'filter type : {type(Demo_result_lists)}')

# Alphabet_demo_lists = ['a', 'b', 'C', 'D', 'e', 'F', 'H', 'i']
#
# Upper_result_lists = filter(lambda x: x.isupper(), Alphabet_demo_lists)
# Lower_result_lists = filter(lambda x: x.islower(), Alphabet_demo_lists)
#
# Upper_result_lists = list(Upper_result_lists)
# Lower_result_lists = list(Lower_result_lists)
#
# print(f'Upper : {Upper_result_lists}')
# print(f'Lower : {Lower_result_lists}')

# a = [1,2,3,4,5,6,7,8,9]
# r = map(lambda x:x**2,a)
# print(list(r))

# a = [1,2,3,4,5,6,7,8,9]
# b = [9,8,7,6,5,4,3,2,1]
# r1 = map((lambda x,y:x+y),a,b)
# print(list(r1))
# r2 = map((lambda x,y:(x+y,x*y)),a,b)
# print(list(r2))

# sentence = "Welcome To Beijing!"
# words = sentence.split()
# lengths  = map(lambda x:len(x),words)
# print(list(lengths))
#
#


# !/usr/bin/python3

import smtplib
from email.mime.text import MIMEText
from email.header import Header

# 第三方 SMTP 服务
mail_host = "smtp.qq.com"  # 设置服务器
mail_user = "923676904@qq.com"  # 用户名
mail_pass = "icgiekcjlisebdgg"  # 口令

sender = '923676904@qq.com'
receivers = ['ningque100@163.com']  # 接收邮件，可设置为你的QQ邮箱或者其他邮箱

message = MIMEText('Python 邮件发送测试...', 'plain', 'utf-8')
message['From'] = Header("ningque", 'utf-8')
message['To'] = Header("测试", 'utf-8')

subject = 'Python SMTP 邮件测试'
message['Subject'] = Header(subject, 'utf-8')

try:
    smtpObj = smtplib.SMTP(mail_host, 25)
    smtpObj.login(mail_user, mail_pass)
    smtpObj.sendmail(sender, receivers, message.as_string())
    print("邮件发送成功")
except smtplib.SMTPException:
    print("Error: 无法发送邮件")

# runner.send_email(host='smtp.qq.com',
#                   port=465,
#                   user='923676904@qq.com',
#                   password='icgiekcjlisebdgg',
#                   to_addrs=['923676904@qq.com', '287790268@qq.com', '971710662@qq.com']
#                   )
